 <div class="form-group container">
	 <form class="form-inline">
	 <p class="text-center" style="margin-top: 20px">
	  <label>选择学生：</label>
		 <input type="text" class="form-control"  id="ooo"  name="ooo"   />
	 </p>
	 </form>
</div>
 <div id="div1" class="container" >
   <table id="mytable">
	 
   </table>
 </div>
<script type="text/javascript">
	$(function(){
		$('#ooo').combobox({
			url:'banji/list',
			 valueField:'id',
			textField:'name', 
			onchange:function(id){
				var o=document.getElementById('div1');
				o.innerHTML='';
				$('#div1').append("<table id='mytable'><table/>")
				$('#mytable').datagrid({
					path:'student',
					url:'page?classId='+id,
					editUrl:'edit?classId='+id,
					search: false, 
					columns:[
						[
						{title:'aa',field:'aa',checkbox:true},//选择对号框，
					    {field:'stuNo',title:'学号'},
					    {field:'name',title:'姓名'},
					    {field:'file',title:'照片'},
						]
						],
						buttons:[$.fn.datagrid.toolbar.buttons.add,	$.fn.datagrid.toolbar.buttons.edit,$.fn.datagrid.toolbar.buttons.search,$.fn.datagrid.toolbar.buttons.remove,
							$.createBtn({
								// btnCls:'btn btn-secondary',
								iconCls:'glyphicon glyphicon-refresh',
								text:'重置密码',
								handler:function(){
									var self=$(this);
									var grid=$.fn.datagrid.toolbar.grid(self);
									var row=grid.bootstrapTable('getSelections');
									if(!row.length){
										bootbox.alert('请选择一名学生，再进行操作');
										return ;
									}
									bootbox.confirm('是否要重置该学生密码？',function(aa){
										if(aa){
										$.post('student/resetPwd',{id:row[0].id},function(result){
											bootbox.alert('密碼重置成功！');
										})
											}
										
									})
								}
								
							}),
							$.createBtn({
							//	btnCls:'btn btn-secondary',
									iconCls: 'glyphicon glyphicon-search',
									text: '查看照片',
									handler: function() {
										var self=$(this);
										var grid=$.fn.datagrid.toolbar.grid(self);
										var row=grid.bootstrapTable('getSelections');
										if(!row.length){
											bootbox.alert('请选择一名学生，再进行操作');
											return ;
										}
										
										var dialog = $.createDialog({
											title:'学生照片',
											buttons:[$.createBtn({
												iconCls:'fa fa-remove',
												text:'关闭',
												isCloseBtn:true,
												handler:function(){
													$('#img').empty();
												}
											
											})]
										}).on('hidden.bs.modal',function(){
											dialog.remove();
											$('#img').empty();
										})
										var bo=dialog.find("div.modal-body");
										var img = $("<img id='img'/>");
										img.attr('src', 'student/download?id=' + row[0].id);
										img.attr('width', '100%');
										img.appendTo(bo);
										dialog.modal('show');
										
										
									}

								})
							]
					
				})
			}
		})
	})
</script>
<style type="text/css">
	
	.center-block {
	  display: block;
	  margin-left: auto;
	  margin-right: auto;
	}
</style>